package com.nondo.rdp.auth.repository;

import com.nondo.rdp.core.common.StatusConstant;

import com.nondo.rdp.auth.domain.PointsLog;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.Optional;

public interface PointsLogRepository extends JpaRepository<PointsLog, Long>, JpaSpecificationExecutor<PointsLog> {
    @Query("select a from PointsLog a where a.id=:id and delFlag = '" + StatusConstant.DEL_FLAG_NORMAL + "'")
    Optional<PointsLog> findOne(@Param("id") int id);

    PointsLog save(PointsLog PointsLog);
}
